<?php
/**
 * main config file.
 *
 * @author Zhang Jinlong <466028373@qq.com>
 * @link http://www.ijianzhi.cn
 * @copyright Copyright &copy; 2013 DianJin Soft
 */

return array(
	'basePath' => dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name' => '爱兼职',
    'language' => 'zh_cn',

	'preload' => array('log'),

	'import' => array(
		'application.models.*',
		'application.components.*',
        'application.components.exception.*',
        'application.components.helper.*',
        'application.components.logRoute.*',
        'application.components.oauth.*',
	),

	'modules' => array(
		'gii' => array(
			'class' => 'system.gii.GiiModule',
			'password' => '123456',
			'ipFilters' => array('10.245.0.10', '192.168.1.66', '::1'),
		),
	),

	'components' => array(
		'urlManager' => array(
			'urlFormat' => 'path',
			'rules' => array(
			    'login' => 'site/login',
		        'logout' => 'site/logout',
				'qq/login' => 'oauth/loginForQQ',
		        'qq/callback' => 'oauth/callbackForQQ',
			),
		),

		'db' => array(
			'connectionString' => 'mysql:host=10.245.0.128;dbname=ijianzhi',
			'emulatePrepare' => true,
			'username' => 'root',
			'password' => 'ccmedia!*@(#)',
			'charset' => 'utf8',
		),

		'session' => array(
            'sessionName' => 'ijianzhi_sid',
		),

		'errorHandler' => array(
			// 'errorAction' => 'site/error',
		),

		'log' => array(
			'class' => 'CLogRouter',
			'routes' => array(
				array(
					'class' => 'FilelogRoute',
					'levels' => 'error, warning',
				),

				/*
				array(
					'class' => 'CWebLogRoute',
				),
				*/
			),
		),
	),

	'params' => array(
	    'regex' => array(
            'mobile' => '/^\d{11}$/',
            'phoneHead' => '/^\d{3,4}$/',
            'phoneBody' => '/^\d{6,9}$/',
            'phoneFoot' => '/^(\d{1,4})?$/',
            'phone' => '/^\d{3,4}-\d{6,9}(-\d{1,4})?$/',
            'qq' => '/^\d+$/',
	    ),
	),
);